package com.base.repository;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import javax.ejb.Local;

import com.base.util.Exists;

/**
 * 
 * @author lyw
 *
 * @param <T>
 */
@Local
public interface BasicRepository<T> extends	Serializable {
	public T save(T t);
	public T update(T t);
    public T merge(T t);
    public void delete(T t);
	public boolean remove(T t);
    public boolean removeById(Class<T> clazz,Serializable id);
    public boolean detach(T t);
    public Exists<T> findById(Class<T> clazz,Serializable id);
    public Exists<T> selectOne(String hql,Map<String,Object> paramters);
    public Exists<T> selectOne(String hql,List<Object> paramters);
    public Exists<T> selectOneByName(String namedQuery,Map<String,Object> paramters);
    public Exists<T> selectOneByName(String namedQuery,List<Object> paramters);
    public List<T> select(String hql,Map<String,Object> paramters);
    public List<T> select(String hql,List<Object> paramters);
    public List<T> selectForUpdate(String hql,Map<String,Object> paramters);
    public List<T> selectForUpdate(String hql,List<Object> parameters);
    public List<T> selectByName(String namedQuery,Map<String,Object> parameters);
    public List<T> selectByName(String namedQuery,List<Object> parameters);
    public void executeUpdate(String hql,Map<String,Object> parameters);
    public void executeUpdate(String hql,List<Object> parameters);
    public void executeNativeSQLUpdate(String hql,Map<String, Object> parameters);
    public List<T> nativeSelect(String hql,Class<Object> c,Map<String, Object> parameters);
    public List<T> nativeSelect(String hql,Class<Object> c);
    public List<T> nativeSelect(String hql,Map<String, Object> parameters);
    public List<T> selectForUpdate(String hql, Map<String, Object> paramters,Class<Object> c);
   
}
